<template>
    <div class="option">
        <!-- 商品模块 -->
        <div>
            <div class="img">
                <img v-lazy="data.s_goods_photos[0].path" alt="">
            </div>
            <ul class="text">
                <li>
                    <router-link to="">
                        <span>{{describe1}}</span>
                        <span>{{describe2}}</span>
                    </router-link>
                </li>
                <li>{{data.name}}</li>
            </ul>
            <span class="money">{{price | demoMoney}}</span>
        </div>
        <slot></slot>
    </div>
</template>

<script>
export default {
    props:['data'],
    filters:{
        demoMoney(value) {
            return '￥' + value + ".00"
        }
    },
    data() {
        return {
            describe1:"",
            describe2:"",
            price:""
        }
    },
    created() {
        this.describe1 = this.data["desc"].split('_')[0];
        this.describe2 = this.data["desc"].split('_')[1];
        this.price = this.data.price.toLocaleString('en-US')
        // console.log(this.price);
    },
}
</script>

<style  lang='scss' scoped>
    .option {
        display: flex;
        flex-direction: column;
        justify-content: center;
        margin: 0 0 20px;
        .img {
            img {
                position: relative;
                z-index: -10;
                margin: -40px 0px 0px;
                width: 100%;
            }
        }
        .text {
            margin: -50px 0 0px;
            line-height: 25px;
            font-size: 14px;
            li:first-child {
                a {
                    display: flex;
                    color: #003150;
                    flex-direction: column;
                    justify-content: center;
                }
            }
            li:last-child {
                color: #788997; 
            }
        }
        .money {
            font-size: 18px;
            color: #003150;
            margin: 16px 0;
            font-family: "Microsoft Yahei","å¾®è½¯é›…é»‘","é»‘ä½“","Heiti","åŽæ–‡é»‘ä½“","ST Heiti",'Open Sans','Helvetica Neue',Helvetica,Arial,sans-serif;;
        }
    }
</style>